package com.jeff.tianti.controller;

import com.jeff.tianti.cms.dto.CertificateQueryDTO;
import com.jeff.tianti.cms.service.CertificateService;
import com.jeff.tianti.common.dto.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/certificate")
@CrossOrigin(maxAge = 3600)
public class CertificateController {

    @Autowired
    CertificateService certificateService;


    @RequestMapping(value = "/search", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public AjaxResult index(@RequestBody CertificateQueryDTO certificateQueryDTO) {
        return AjaxResult.setSuccessData(certificateService.findByColumnIdAndNumber(certificateQueryDTO));
    }


}
